//
//  HelpWordsVC.m
//  ShandsMod
//
//  Created by zh s on 2023/3/21.
//  Copyright © 2023 zh_s. All rights reserved.
//

#import "HelpWordsVC.h"
#import "VerifyWordsVC.h"

#import "HelpWordsModel.h"

@interface HelpWordsVC ()

@end

@implementation HelpWordsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navTitle = @"备份助记词";
    self.nav.backgroundColor = UIColor.clearColor;

    UIView *backV = [[UIView alloc] init];
    [self.view addSubview:backV];
    backV.backgroundColor = UIColor.whiteColor;
    backV.frame = CGRectMake(20, NAV_HEIGHT +20, SCREEN_WIDTH - 40, 240);
    [backV settingShadowOpacity:0.2 withShadowColor:RGB(153, 153, 153) wihtShadowRadius:5 withshadowOffset:CGSizeMake(0, 3)];
    GWRadius(backV, 10);
    
    UIImageView *topImg = [[UIImageView alloc] init];
    [backV addSubview:topImg];
    topImg.image = IMAGE_NAME(@"icon_helpWords_top");
    [topImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_equalTo(0);
        make.right.mas_equalTo(backV.mas_right).mas_offset(0);
        make.height.mas_equalTo(50);
    }];
    
    
    UIImageView *explainImg = [[UIImageView alloc] init];
    [backV addSubview:explainImg];
    explainImg.image = IMAGE_NAME(@"icon_helpWords_topExplain");
    [explainImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(42);
        make.centerY.mas_equalTo(topImg.mas_centerY);
        make.width.mas_equalTo(90);
        make.height.mas_equalTo(16);
    }];
    
    ///格子
   NSArray *strArray=@[@"大好人",@"自定义流式标签",@"github",@"code4app",@"已婚",@"阳光开朗",@"慷慨大方帅气身材好",@"仗义",@"值得一交的朋友",@"值得一交的朋友",@"值得的交",@"值得一交的朋友",@"值得一交的朋友",@"大好人"];
    
    NSMutableArray *contentArr = [NSMutableArray arrayWithCapacity:0];
    for (NSString *name in strArray) {
        HelpWordsModel *model = [[HelpWordsModel alloc] init];
        model.name = name;
        [contentArr addObject:model];
    }
    

    GWGoodsListView *tagList = [[GWGoodsListView alloc] initWithFrame:CGRectMake(0, 57, SCREEN_WIDTH - 54, 0)];
    tagList.isSingleSelect = YES;
    [backV addSubview:tagList];
    [tagList setMarginBetweenTagLabel:7 AndBottomMargin:7];
    [tagList setTagWithTagArray:contentArr];
//    tagList.hidden = YES;
//    self.goodHeight = tagList.totalHeight +36;
//    [self.mainTableView reloadData];

    
    //提示
    UIImageView *tipsImg = [[UIImageView alloc] init];
    [self.view addSubview:tipsImg];
    tipsImg.image = IMAGE_NAME(@"icon_helpWords_tips");
    [tipsImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(18);
        make.top.mas_equalTo(backV.mas_bottom).mas_offset(17);
        make.width.mas_equalTo(15);
        make.height.mas_equalTo(15);
    }];
    
    UILabel *tipsLab = [BaseViewFactory labelWithFrame:CGRectZero textColor:RGB(253, 193, 72) font:FONT_NAME(FONT_Medium, 13) textAligment:NSTextAlignmentLeft andtext:@"助记词用于恢复钱包或重置钱包密码，将它准确的抄写在纸上，并存放在只有你知道的安全的地方"];
    [self.view addSubview:tipsLab];
    
    [tipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(tipsImg.mas_right).mas_offset(7);
        make.top.mas_equalTo(backV.mas_bottom).mas_offset(15);
//        make.width.mas_equalTo(SCREEN_WIDTH - 64);
        make.right.mas_equalTo(backV.mas_right);
        make.height.mas_equalTo(42);
    }];
    tipsLab.numberOfLines = 2;
    
    UIButton *nextBtn = [BaseViewFactory buttonWithFrame:CGRectZero font:FONT_NAME(FONT_Semibold, 16) title:@"备份完成，进行验证" titleColor:UIColor.whiteColor backColor:MAIN_ACTIVE_COLOR];
    [self.view addSubview:nextBtn];
    [nextBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(35);
        make.top.mas_equalTo(backV.mas_bottom).mas_offset(77);
        make.width.mas_equalTo(SCREEN_WIDTH - 70);
        make.height.mas_equalTo(40);
    }];
    GWRadius(nextBtn, 20);
    [nextBtn addTarget:self action:@selector(nextBtnClick) forControlEvents:UIControlEventTouchUpInside];
    
}

- (void)nextBtnClick {
    VerifyWordsVC *vc = [[VerifyWordsVC alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}

@end
